package com.meirengu.webview.controller;

import com.meirengu.webview.service.KwProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 导流页
 *
 * @author Mao
 * @create 2017-12-16 19:23
 */
@Controller
@RequestMapping("guide")
public class GuideController extends BaseController {

    @Autowired
    KwProductService kwProductService;

    @RequestMapping("market")
    public ModelAndView market() {
        Map<String, Object> params = new HashMap<>();
        params.put("status", 1);
        List<Map<String, Object>> list = kwProductService.getList(params);
        Map<String, Object> result = new HashMap<>();
        result.put("list", list);
        return new ModelAndView("market", result);
    }

    @RequestMapping("directMarket")
    public ModelAndView directMarket() {
        Map<String, Object> params = new HashMap<>();
        params.put("status", 1);
        List<Map<String, Object>> list = kwProductService.getList(params);
        Map<String, Object> result = new HashMap<>();
        result.put("list", list);
        return new ModelAndView("directMarket", result);
    }
}
